This invention relates generally to identifying software errors, and particularly to detecting errors when calling a function without specifying a receiver object.
A popular feature in programming languages is for subroutines (usually called methods or functions) to have an implicit parameter called ‘this.’ Often called the receiver or receiver object, the ‘this’ parameter is conceptually the object on which a function is performed. For example, when calling the Show function for a Window, a programmer may pass a Window as its ‘this’ parameter.
Some languages, such as ECMAScript, also known as JavaScript, have a feature in which specifying no ‘this’ parameter in a function call implicitly binds the ‘this’ parameter to a special value. Though this usage will execute, authors of functions that use the ‘this’ parameter rarely expect such a special value; thus, failing to specify an explicit ‘this’ parameter in calling some functions may be a mistake that can lead to a variety of unexpected program behaviors. Software defects are costly in impact and costly to correct after first introduction, so detecting mistakes in programming is valuable.
Commercial static analysis tools are software packages that run static analyses on other software, and commonly report results in the form of defects discovered in the analyzed software.